# $Id: PKGBUILD 78208 2012-10-17 10:25:06Z allan $
# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Elis Hughes <elishughes@googlemail.com>

pkgname=pssh
pkgver=2.3.1
pkgrel=4
pkgdesc="Parallel versions of the openssh tools ssh, scp, rsync, nuke, slurp"
arch=('any')
url="http://code.google.com/p/parallel-ssh/"
license=('BSD')
depends=('openssh' 'python')
changelog=$pkgname.changelog
source=(http://parallel-ssh.googlecode.com/files/$pkgname-$pkgver.tar.gz
	Imports-are-absolute-by-default-in-Python3.patch)
sha256sums=('539f8d8363b722712310f3296f189d1ae8c690898eca93627fc89a9cb311f6b4'
            '12257c60e7db3d152f0b3307d0cd0263a95bddfc856aa570908a0491a1a03c56')

build() {
  cd ${srcdir}/$pkgname-$pkgver

  # fix FS#28626 (merged upstream)
  patch -Np1 -i ../Imports-are-absolute-by-default-in-Python3.patch
}

package() {
  cd ${srcdir}/$pkgname-$pkgver
  python setup.py install --root ${pkgdir}

  # fix manpages
  install -d ${pkgdir}/usr/share
  mv ${pkgdir}/usr/man  ${pkgdir}/usr/share

  # fix putty pscp file conflict
  mv ${pkgdir}/usr/bin/pscp  ${pkgdir}/usr/bin/psshscp
  mv ${pkgdir}/usr/share/man/man1/pscp.1  ${pkgdir}/usr/share/man/man1/psshscp.1
  
  # license
  install -D -m644 COPYING ${pkgdir}/usr/share/licenses/$pkgname/COPYING
}
